package com.edt.ichannel.api.controller;


import com.edt.ichannel.api.common.controller.BaseController;
import com.edt.ichannel.api.service.EdtApiService;
import com.edt.ichannel.api.service.WechatService;
import com.edt.ichannel.utils.ReadUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * CreateBy:zyp
 * CreateDate:2018/3/7
 * UpdateBy:
 * UpdateDate:
 * Description:微信
 **/
@Controller
@RequestMapping("/weChat")
public class WechatController extends BaseController {

    @Resource
    EdtApiService edtApiService;
    @Resource
    private WechatService wechatService;
    private Logger logger = LogManager.getLogger(WechatController.class);

    @RequestMapping(value = "sendTemplateMessage", method = RequestMethod.POST)
    @ResponseBody
    public void sendTemplateMessage(HttpServletRequest request) {
        String res = ReadUtil.readRequestBody(request);
        wechatService.sendTemplateMessage(res);
    }


}
